package it.polimi.digitalstate.manager;

import java.util.ArrayList;

import it.polimi.digitalstate.dto.CitizenDTO;
import it.polimi.digitalstate.dto.ElectionDTO;
import it.polimi.digitalstate.dto.ElectionVoteDTO;
import it.polimi.digitalstate.dto.PartyDTO;

import javax.annotation.security.RolesAllowed;
import javax.ejb.Local;

@Local
public interface ElectionManagerLocal {
	/**
	 * This method allows the governor to create a new Election
	 * @param election_dto
	 */
	@RolesAllowed({"governor"})
	public void createNewElection(ElectionDTO election_dto) throws managerexception.CannotSaveElection;	
	/**
	 * This method gives the information about if the citizen has already voted or not
	 * @param election_dto true if the citizen has already voted
	 */
	
	public boolean correctElectionDates(ElectionDTO election_dto);

	
	@RolesAllowed({"governor","citizen"})
	public boolean hasElectionVoted(CitizenDTO citizen, ElectionDTO election);
	/**
	 * This method allow the citizen to express the vote
	 */

    public void submitElectionVote(ElectionVoteDTO electionvote) throws managerexception.CannotSendElectionVote;
    /**
     * This method check if the citizen can perform the Vote or not
     * @param Citizen the citizen who wants to perform the vote
     * @param election His vote
     * @return true if the citizen can vote
     */

    public boolean hasAlreadyElectionVoted(CitizenDTO citizen);
	/**
	 * This method allow the citizen to express the vote
	 */
    
    public boolean electionIsOpen();
    
	boolean isElection();

	boolean isCandidacy();

	String getElectionNames();
	public ElectionVoteDTO[] getElectionResults();
	
}

